home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / sppsvx.z / sppsvx
Encoding:
Text File  |  2002-10-03  |  11.8 KB  |  331 lines

  1.  
  2.  
  3.  
  4. SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SPPSVX - use the Cholesky factorization A = U**T*U or A = L*L**T to
  10.      compute the solution to a real system of linear equations A * X = B,
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE SPPSVX( FACT, UPLO, N, NRHS, AP, AFP, EQUED, S, B, LDB, X,
  14.                         LDX, RCOND, FERR, BERR, WORK, IWORK, INFO )
  15.  
  16.          CHARACTER      EQUED, FACT, UPLO
  17.  
  18.          INTEGER        INFO, LDB, LDX, N, NRHS
  19.  
  20.          REAL           RCOND
  21.  
  22.          INTEGER        IWORK( * )
  23.  
  24.          REAL           AFP( * ), AP( * ), B( LDB, * ), BERR( * ), FERR( * ),
  25.                         S( * ), WORK( * ), X( LDX, * )
  26.  
  27. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  28.      These routines are part of the SCSL Scientific Library and can be loaded
  29.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  30.      directs the linker to use the multi-processor version of the library.
  31.  
  32.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  33.      4 bytes (32 bits). Another version of SCSL is available in which integers
  34.      are 8 bytes (64 bits).  This version allows the user access to larger
  35.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  36.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  37.      only one of the two versions; 4-byte integer and 8-byte integer library
  38.      calls cannot be mixed.
  39.  
  40. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  41.      SPPSVX uses the Cholesky factorization A = U**T*U or A = L*L**T to
  42.      compute the solution to a real system of linear equations A * X = B,
  43.      where A is an N-by-N symmetric positive definite matrix stored in packed
  44.      format and X and B are N-by-NRHS matrices.
  45.  
  46.      Error bounds on the solution and a condition estimate are also provided.
  47.  
  48.  
  49. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  50.      The following steps are performed:
  51.  
  52.      1. If FACT = 'E', real scaling factors are computed to equilibrate
  53.         the system:
  54.            diag(S) * A * diag(S) * inv(diag(S)) * X = diag(S) * B
  55.         Whether or not the system will be equilibrated depends on the
  56.         scaling of the matrix A, but if equilibration is used, A is
  57.         overwritten by diag(S)*A*diag(S) and B by diag(S)*B.
  58.  
  59.      2. If FACT = 'N' or 'E', the Cholesky decomposition is used to
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  71.  
  72.  
  73.  
  74.         factor the matrix A (after equilibration if FACT = 'E') as
  75.            A = U**T* U,  if UPLO = 'U', or
  76.            A = L * L**T,  if UPLO = 'L',
  77.         where U is an upper triangular matrix and L is a lower triangular
  78.         matrix.
  79.  
  80.      3. If the leading i-by-i principal minor is not positive definite,
  81.         then the routine returns with INFO = i. Otherwise, the factored
  82.         form of A is used to estimate the condition number of the matrix
  83.         A.  If the reciprocal of the condition number is less than machine
  84.         precision, INFO = N+1 is returned as a warning, but the routine
  85.         still goes on to solve for X and compute error bounds as
  86.         described below.
  87.  
  88.      4. The system of equations is solved for X using the factored form
  89.         of A.
  90.  
  91.      5. Iterative refinement is applied to improve the computed solution
  92.         matrix and calculate error bounds and backward error estimates
  93.         for it.
  94.  
  95.      6. If equilibration was used, the matrix X is premultiplied by
  96.         diag(S) so that it solves the original system before
  97.         equilibration.
  98.  
  99.  
  100. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  101.      FACT    (input) CHARACTER*1
  102.              Specifies whether or not the factored form of the matrix A is
  103.              supplied on entry, and if not, whether the matrix A should be
  104.              equilibrated before it is factored.  = 'F':  On entry, AFP
  105.              contains the factored form of A.  If EQUED = 'Y', the matrix A
  106.              has been equilibrated with scaling factors given by S.  AP and
  107.              AFP will not be modified.  = 'N':  The matrix A will be copied to
  108.              AFP and factored.
  109.              = 'E':  The matrix A will be equilibrated if necessary, then
  110.              copied to AFP and factored.
  111.  
  112.      UPLO    (input) CHARACTER*1
  113.              = 'U':  Upper triangle of A is stored;
  114.              = 'L':  Lower triangle of A is stored.
  115.  
  116.      N       (input) INTEGER
  117.              The number of linear equations, i.e., the order of the matrix A.
  118.              N >= 0.
  119.  
  120.      NRHS    (input) INTEGER
  121.              The number of right hand sides, i.e., the number of columns of
  122.              the matrices B and X.  NRHS >= 0.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      AP      (input/output) REAL array, dimension (N*(N+1)/2)
  141.              On entry, the upper or lower triangle of the symmetric matrix A,
  142.              packed columnwise in a linear array, except if FACT = 'F' and
  143.              EQUED = 'Y', then A must contain the equilibrated matrix
  144.              diag(S)*A*diag(S).  The j-th column of A is stored in the array
  145.              AP as follows:  if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for
  146.              1<=i<=j; if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for
  147.              j<=i<=n.  See below for further details.  A is not modified if
  148.              FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.
  149.  
  150.              On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by
  151.              diag(S)*A*diag(S).
  152.  
  153.      AFP     (input or output) REAL array, dimension
  154.              (N*(N+1)/2) If FACT = 'F', then AFP is an input argument and on
  155.              entry contains the triangular factor U or L from the Cholesky
  156.              factorization A = U'*U or A = L*L', in the same storage format as
  157.              A.  If EQUED .ne. 'N', then AFP is the factored form of the
  158.              equilibrated matrix A.
  159.  
  160.              If FACT = 'N', then AFP is an output argument and on exit returns
  161.              the triangular factor U or L from the Cholesky factorization A =
  162.              U'*U or A = L*L' of the original matrix A.
  163.  
  164.              If FACT = 'E', then AFP is an output argument and on exit returns
  165.              the triangular factor U or L from the Cholesky factorization A =
  166.              U'*U or A = L*L' of the equilibrated matrix A (see the
  167.              description of AP for the form of the equilibrated matrix).
  168.  
  169.      EQUED   (input or output) CHARACTER*1
  170.              Specifies the form of equilibration that was done.  = 'N':  No
  171.              equilibration (always true if FACT = 'N').
  172.              = 'Y':  Equilibration was done, i.e., A has been replaced by
  173.              diag(S) * A * diag(S).  EQUED is an input argument if FACT = 'F';
  174.              otherwise, it is an output argument.
  175.  
  176.      S       (input or output) REAL array, dimension (N)
  177.              The scale factors for A; not accessed if EQUED = 'N'.  S is an
  178.              input argument if FACT = 'F'; otherwise, S is an output argument.
  179.              If FACT = 'F' and EQUED = 'Y', each element of S must be
  180.              positive.
  181.  
  182.      B       (input/output) REAL array, dimension (LDB,NRHS)
  183.              On entry, the N-by-NRHS right hand side matrix B.  On exit, if
  184.              EQUED = 'N', B is not modified; if EQUED = 'Y', B is overwritten
  185.              by diag(S) * B.
  186.  
  187.      LDB     (input) INTEGER
  188.              The leading dimension of the array B.  LDB >= max(1,N).
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  203.  
  204.  
  205.  
  206.      X       (output) REAL array, dimension (LDX,NRHS)
  207.              If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to the
  208.              original system of equations.  Note that if EQUED = 'Y', A and B
  209.              are modified on exit, and the solution to the equilibrated system
  210.              is inv(diag(S))*X.
  211.  
  212.      LDX     (input) INTEGER
  213.              The leading dimension of the array X.  LDX >= max(1,N).
  214.  
  215.      RCOND   (output) REAL
  216.              The estimate of the reciprocal condition number of the matrix A
  217.              after equilibration (if done).  If RCOND is less than the machine
  218.              precision (in particular, if RCOND = 0), the matrix is singular
  219.              to working precision.  This condition is indicated by a return
  220.              code of INFO > 0.
  221.  
  222.      FERR    (output) REAL array, dimension (NRHS)
  223.              The estimated forward error bound for each solution vector X(j)
  224.              (the j-th column of the solution matrix X).  If XTRUE is the true
  225.              solution corresponding to X(j), FERR(j) is an estimated upper
  226.              bound for the magnitude of the largest element in (X(j) - XTRUE)
  227.              divided by the magnitude of the largest element in X(j).  The
  228.              estimate is as reliable as the estimate for RCOND, and is almost
  229.              always a slight overestimate of the true error.
  230.  
  231.      BERR    (output) REAL array, dimension (NRHS)
  232.              The componentwise relative backward error of each solution vector
  233.              X(j) (i.e., the smallest relative change in any element of A or B
  234.              that makes X(j) an exact solution).
  235.  
  236.      WORK    (workspace) REAL array, dimension (3*N)
  237.  
  238.      IWORK   (workspace) INTEGER array, dimension (N)
  239.  
  240.      INFO    (output) INTEGER
  241.              = 0:  successful exit
  242.              < 0:  if INFO = -i, the i-th argument had an illegal value
  243.              > 0:  if INFO = i, and i is
  244.              <= N:  the leading minor of order i of A is not positive
  245.              definite, so the factorization could not be completed, and the
  246.              solution has not been computed. RCOND = 0 is returned.  = N+1: U
  247.              is nonsingular, but RCOND is less than machine precision, meaning
  248.              that the matrix is singular to working precision.  Nevertheless,
  249.              the solution and error bounds are computed because there are a
  250.              number of situations where the computed solution can be more
  251.              accurate than the value of RCOND would suggest.
  252.  
  253. FFFFUUUURRRRTTTTHHHHEEEERRRR DDDDEEEETTTTAAAAIIIILLLLSSSS
  254.      The packed storage scheme is illustrated by the following example when N
  255.      = 4, UPLO = 'U':
  256.  
  257.      Two-dimensional storage of the symmetric matrix A:
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          SSSSPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  269.  
  270.  
  271.  
  272.         a11 a12 a13 a14
  273.             a22 a23 a24
  274.                 a33 a34     (aij = conjg(aji))
  275.                     a44
  276.  
  277.      Packed storage of the upper triangle of A:
  278.  
  279.      AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
  280.  
  281.  
  282. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  283.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  284.  
  285.      This man page is available only online.
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.